package com.zhongke.cotrun.mapper;

import com.zhongke.cotrun.model.pojo.Facilitator;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;


public interface FacilitatorMapper {

    /**
     * 新建服务商信息
     * @param facilitator
     * @return
     */
    @Insert(" INSERT INTO `facilitator` (`link_user`,`application_description`,`description`,`create_time`, `audit_status`) VALUES" +
            " (#{linkUser},#{applicationDescription},#{description}, NOW(),0)")
    public boolean insertFacilitator(Facilitator facilitator);


// SELECT  f.*,u.real_name FROM facilitator f INNER JOIN user_info u ON f.link_user=u.user_id AND u.state=0

    /**
     * 根据关联userid查询服务商认证信息
     * @param linkUser
     * @return
     */
   @Select("SELECT * FROM facilitator WHERE link_user=#{linkUser}")
    public  Facilitator selectFacilitatorByLinkId(Integer linkUser);

    /**
     * 修改专家认证信息
     * @param facilitator
     * @return
     */
    public  Boolean updateFacilitator(Facilitator facilitator);

    /**
     * 根据id查看服务商认证信息
     * @param id
     * @return
     */
    @Select("SELECT * FROM facilitator WHERE facilitator_id=#{id}")
    public  Facilitator selectFacilitatorById(Integer id);

}
